<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTableUserInsuranceLogs extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_insurance_logs', function (Blueprint $table) {
            $table->comment = '用户购买保险监控';

            $table->increments('id');
            $table->integer('user_id')->default(0)->comment('用户id');
            $table->string('error_msg')->default('')->comment('提示信息');
            $table->tinyInteger('type')->default(0)->comment('失败类型:1.已经申请过保险 2.身份证或用户名为空3.未查到身份信息  4.购买保险失败   5.网络异常 6.购买成功');
            $table->tinyInteger('is_success')->default(0)->comment('是否成功，0.失败，1.成功');
            $table->string('code')->default('999')->comment('提示编号:000.领取保单成功001.参数异常002.该手机号在近期已领取过保险003.领取失败 999.其他错误');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_insurance_logs');
    }
}
